package org.coral.server.game.module.hero.domain;

import java.util.List;
import java.util.Map;
import java.util.Collection;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.kepe.dragon.persistent.domain.Hero;

import org.coral.server.core.server.AbstractModuleMultiDomain;
import org.coral.server.game.module.resource.IResourceDomain;
import org.coral.server.game.module.resource.domain.ItemResourceDomain;

/**
* HeroDomain
* @author Jeremy
*/

public class HeroDomain extends AbstractModuleMultiDomain<Long, Hero> implements IResourceDomain<Long, Hero>{

	private static final Logger log = LoggerFactory.getLogger(HeroDomain.class);
	
	private static final int LIMIT = 999; 
	
	/**
	 * 资源代理对象
	 */
	private IResourceDomain<Long, Hero> resourceDomainProxy;
	
	public HeroDomain(){
		
	}

	
	////////////业务代码////////////////////
	
	
	@Override
	public void afterInit() {
		this.resourceDomainProxy = HeroResourceDomain.create(playerId, getBeanMap());
	}
	
	@Override
	public Hero getBeanByConfigId(int configId) {
		return resourceDomainProxy.getBeanByConfigId(configId);
	}

	//@Override
	//public Collection<Hero> getBeansByConfigId(int configId) {
	//	return resourceDomainProxy.getBeansByConfigId(configId);
	//}

	@Override
	public boolean checkAdd(int configId, int count) {
		return resourceDomainProxy.checkAdd(configId, count);
	}

	@Override
	public List<Hero> add(int configId, int count) {
		return resourceDomainProxy.add(configId, count);
	}

	@Override
	public boolean checkEnough(int configId, int count) {
		return resourceDomainProxy.checkEnough(configId, count);
	}

	@Override
	public boolean costByConfigId(int configId, int count) {
		return resourceDomainProxy.costByConfigId(configId, count);
	}

	@Override
	public boolean costById(Long id, int count) {
		return resourceDomainProxy.costById(id, count);
	}

	@Override
	public List<Hero> getUpdateItemList() {
		return resourceDomainProxy.getUpdateItemList();
	}

	@Override
	public List<Hero> getDeleteItemList() {
		return resourceDomainProxy.getDeleteItemList();
	}
}

